import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Product/Home'
import firstTerm from '../views/Product/firstTerm'
Vue.use(VueRouter)


const routes = [
  // 模块开发中

  {
    path: '/wait',
    component: () => import('@/views/WaitPlease.vue')
    
  },
  {
  // 商品模块路由
  path: '/',
  redirect: '/product/firstTerm'
},
// 1.商品首页Home
{
  path: '/product/home',
  name: 'Home',
  component: Home,
  // 首页嵌套路由
  children: [
    
     {
        path:'/product/firstTerm',
        name:'firstTerm',
        component:firstTerm
      },
    // 2.消息 Message
    {
      path: '/user/message',
      name: 'Message',
      component: () => import('@/views/User/Message')
    },
    // 3.好物推荐 Recommand
    {
      path: '/product/recommand',
      name: 'Recommand',
      component: () => import('@/views/Product/Recommand')
    },
    // 4.购物车 Cart
    {
      path: '/product/cart',
      name: 'Cart',
      component: () => import('@/views/Product/Cart')
    },
    // 5.我的淘宝 Mytaobao
    {
      path: '/set/mytaobao',
      name: 'Mytaobao',
      component: () => import('@/views/Set/Mytaobao')
    }
  ]
},
// 5.商品分类Class
{
  path: '/product/class',
  name: 'Class',
  component: () => import('@/views/Product/Class')
},
// 6.商品详情Details
{
  path: '/product/details',
  name: 'Details',
  component: () => import('@/views/Product/Details')
},
// 7.收藏夹Collections
{
  path: '/product/collections',
  name: 'Collections',
  component: () => import('@/views/Product/Collections')
},
// 8.订单结算 Order
{
  path: '/product/order',
  name: 'Order',
  component: () => import('@/views/Product/Order')
},

// 用户模块路由
// 1.注册页面 Register
{
  path: '/user/register',
  name: 'Register',
  component: () => import('@/views/User/Register')

},
// 2.登录页面 Login
{
  path: '/user/login',
  name: 'Login',
  component: () => import('@/views/User/Login')
},
// 3.评价页面 Evaluate
{
  path: '/user/evaluate',
  name: 'Evaluate',
  component: () => import('@/views/User/Evaluate')
},
// 4.用户模块的消息页面嵌套在home中

// 5.个人信息页面 Information
{
  path: '/user/information',
  name: 'Information',
  component: () => import('@/views/User/Information')
},
// 设置模块路由
// 1.我的淘宝嵌套在home中

// 2.设置详细分类 Setdetail
{
  path: '/set/setdetail',
  name: 'SetDetail',
  component: () => import('@/views/Set/SetDetail')
},
// 3.收货地址 Adress
{
  path: '/set/adress',
  name: 'Adress',
  component: () => import('@/views/Set/Adress')
},
// 4.添加收货地址表单 AddUserAdress
{
  path: '/set/adduseradress',
  name: 'AddUserAdress',
  component: () => import('@/views/Set/AddUserAdress')
}

]

const router = new VueRouter({
  routes
})

export default router
